package com.ky.home.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ky.common.vo.R;
import com.ky.home.entity.School;
import com.ky.home.mapper.SchoolMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lgh
 * @since 2024-06-20
 */
@RestController
@RequestMapping("/home")
public class SchoolController {
    @Autowired
    SchoolMapper schoolMapper;
    @RequestMapping("/school/selectByCity/{city}")
    public R selectByCity(@PathVariable("city") String city) {
        QueryWrapper<School> schoolQueryWrapper = new QueryWrapper<>();
        schoolQueryWrapper.eq("city", city);
        return R.ok(schoolMapper.selectList(schoolQueryWrapper));
    }
}

